package com.eurasia.assignment.domain;

import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@AllArgsConstructor
@NoArgsConstructor
@Data
public class Class {
    
    private Long id;

    private String className;
    
    private String grade;
    
    private String major;
    
    private String tutor;


    private Integer studentCount;
    
    private LocalDateTime createTime;
    
    private String remark;
    
    public static Class create(String className, String grade, String major, String tutor, Integer studentCount, String remark) {
        Class newClass = new Class();
        newClass.setClassName(className);
        newClass.setGrade(grade);
        newClass.setMajor(major);
        newClass.setTutor(tutor);
        newClass.setStudentCount(studentCount);
        newClass.setCreateTime(LocalDateTime.now());
        newClass.setRemark(remark);
        return newClass;
    }


    /**
     * 更新班级信息
     * @param className 班级名称
     * @param grade 年级
     * @param major 专业
     * @param tutor 班主任
     * @param studentCount 学生数量
     * @param remark 备注
     */
    public void update(String className, String grade, String major, String tutor, 
                      Integer studentCount, String remark) {
        this.className = className;
        this.grade = grade;
        this.major = major;
        this.tutor = tutor;
        this.studentCount = studentCount;
        this.remark = remark;
    }
   
} 